<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" type="text/css" href="../../css/style.css" />
		<link rel="stylesheet" type="text/css" href="../../css/demo.css" />
		<script src="../../js/demo.js" type="text/javascript" charset="utf-8"></script>
		<title>添加商品</title>
	</head>
	<body>
		<!--header-->
		<div class="header">
			<div class="header-content">
				<ul class="nav left">
					<li><img src="../../img/regist-arrow.png" /></li>
					<li class="nav-one">
						<a href="javascript:history.go(-1);">返回</a>
					</li>
					<li class="nav-two">
						<a href="../../">关闭</a>
					</li>
				</ul>
				<p class="left">添加商品</p>
				<div class="right nav_right">
					<img src="../../img/regist-list.png" />
				</div>
			</div>
		</div>
		<!--main-->
		<div class="main clear" style="margin-bottom: 1rem;">
			<div class="productaction">
				<ul class="productactionlist">
					<li class="action-one"><img src="../../imgs/product-icon25.jpg"/></li>
				</ul>
				<ul class="productactioncircle">
					<li class="circle"></li>
					<li class="circle"></li>
					<li class="circle"></li>
					<li class="circle"></li>
				</ul>
				<div class="action-fix">
					<img src="../../img/product-icon24.png" class="left"/>
					<div class="right">
						<img src="../../img/product-icon21.png"/>
					    <img src="../../img/list.png" style="margin-left: 0.29rem;"/>
					</div>
				</div>
			</div>
			<div class="productaction2">
				<ul class="productactionlist2">
					<li class="productactionlist2-one"></li>
					<li class="productactionlist2-two"></li>
					<li class="productactionlist2-thr"></li>
					<li class="productactionlist2-fou">运费：免运费 <span class="fou-one"></span></li>
				</ul>
			</div>
			<div class="productaction3">
				<ul class="productactionlist3">
					<li><img src="../../img/product-icon15.png"/>正品保障</li>
					<li><img src="../../img/product-icon16.png"/>全场包邮</li>
				</ul>
			</div>
			<div class="productaction4">
				<ul class="productactionlist4">
					<li class="left">请选择  规格  数量</li>
					<li class="right"><img src="../../img/interface-icon2.png"/></li>
				</ul>
			</div>
			<div class="productaction5">
				<ul class="productactionlist5">
					<li class="left">商品评价 (<span id="span1"></span>)</li>
					<li class="right">好评率 <span style="color: #ff5c36;">100%</span></li>
				</ul>
				<div id="d1">
				<ul class="productactionlist6">
					<li class="productlist6-one"></li>
					<li class="productlist6-two"></li>
					<li class="productlist6-thr"></li>
				</ul>
				</div>
				<div class="productactionlist7" onclick="scanMore()">查看更多评价</div>
			</div>
			<div class="productaction8">
			</div>
		</div>
		<div class="productlist-foot">
			<ul class="productlist-footlist left">
				<li class="productlist-footlist-one"><img src="../../img/product-icon22.png"/><br />客服</li>
				<li class="productlist-footlist-one"><img src="../../img/divide-icon19.png"/><br />店铺</li>
				<li class="productlist-footlist-one" style="margin-right: 0;"><img src="../../img/shopopen-icon18.png"/><br />分类</li>
			</ul>
			<div class="productlist-footlist2 left">
				加入分销
			</div>
			<div class="productlist-footlist3 left">
				立即购买
			</div>
		</div>
		<script src="../../js/jquery-3.2.1.min.js" type="text/javascript"
		charset="utf-8"></script>
		<script type="text/javascript">
		//得到请求参数
		var shopGoodId=location.search.substr(1);
		//显示商品信息
			showHtml(shopGoodId);
			function showHtml(dataStr){
				$.ajax({
					type:"post",
					url:"/qiaomengapp/shopGood/showHtml",
					data:"shopGoodId="+dataStr,
					dataType:"json",
					//需要参数shopgoodid
					success:function(data){
						$('.productactionlist2-one').html(data.goodDesc);
						$('.productactionlist2-two').html("分类:"+data.oneName+">"+data.twoName);
						$('.productactionlist2-thr').html("<span class='thr-one'>￥"+data.price*0.6+" </span><span class='thr-two'>￥"+data.price+"</span> <span class='thr-thr'>￥"+data.price*0.03+"</span> 返佣");
						$('.fou-one').html("所在地:"+data.provinceName+"&nbsp;"+data.cityName);
						if(data.status==2){
							$('.productaction8').html("该商品已下架");
						}else{
							$('.productaction8').html("该商品正在热销中");
						}
					}
				});			
			}
			
			//显示评价
			showHtml2(shopGoodId);
			function showHtml2(dataStr){
				$.ajax({
					type:"post",
					url:"/qiaomengapp/Evaluate/goodEvaluates",
					data:"shopGoodId="+dataStr,
					dataType:"json",
					//需要参数shopgoodid
					success:function(data){
						$('#span1').html(data.length);
						var b="";
						for(var i=0;i<3;i++){
							var time=data[i].createTimeStr;
							var a="<ul class='productactionlist6'>"
								+"<li class='productlist6-one'><img src='"+data[i].headImg+"'/>"+data[i].name+"</li>"
								+"<li class='productlist6-two'>"+data[i].evaluateMsg+"</li>"
								+"<li class='productlist6-thr'>"+time+"</li>"
								+"</ul>";
							b+=a;
							$('#d1').html(b);
							}
						}
				});		
			}
			
			//查看更多评价
			function scanMore(){
				$.ajax({
					type:"post",
					url:"/qiaomengapp/Evaluate/goodEvaluates",
					data:"shopGoodId="+dataStr,
					dataType:"json",
					//需要参数shopgoodid
					success:function(data){
						$('#span1').html(data.length);
						var b="";
						for(var i=0;i<data.length;i++){
							var time=data[i].createTimeStr;
							var a="<ul class='productactionlist6'>"
								+"<li class='productlist6-one'><img src='"+data[i].headImg+"'/>"+data[i].name+"</li>"
								+"<li class='productlist6-two'>"+data[i].evaluateMsg+"</li>"
								+"<li class='productlist6-thr'>"+time+"</li>"
								+"</ul>";
								b+=a;
								$('#d1').html(b);
						}
					}
				});		
			}
		</script>
	</body>
</html>